package com.meituan.catering.management.order.biz.model.converter;

import com.meituan.catering.management.order.biz.model.CateringOrderItemBO;
import com.meituan.catering.management.order.dao.model.CateringOrderItemDO;

import java.util.LinkedList;
import java.util.List;

/**
 * @author Believe
 * Date 2022/5/28 14:15
 */
public class CateringOrderItemBOConverter {
    public static List<CateringOrderItemBO> toCateringOrderItemBO(List<CateringOrderItemDO> orderItemDOList){
        List<CateringOrderItemBO> orderItemBOList = new LinkedList<>();
        for (CateringOrderItemDO cateringOrderItemDO : orderItemDOList) {
            CateringOrderItemBO cateringOrderItemBO = new CateringOrderItemBO();
            cateringOrderItemBO.setId(cateringOrderItemDO.getId());
            cateringOrderItemBO.setTenantId(cateringOrderItemDO.getTenantId());
            cateringOrderItemBO.setVersion(cateringOrderItemDO.getVersion());
            cateringOrderItemBO.setSeqNo(cateringOrderItemDO.getSeqNo());
            cateringOrderItemBO.setStatus(cateringOrderItemDO.getStatus());
            cateringOrderItemBO.setPlaceQuantity(cateringOrderItemDO.getPlaceQuantity());
            cateringOrderItemBO.setProduceQuantity(cateringOrderItemDO.getProduceQuantity());
            cateringOrderItemBO.setLatestQuantity(cateringOrderItemDO.getLatestQuantity());
            cateringOrderItemBO.setProductId(cateringOrderItemDO.getProductId());
            cateringOrderItemBO.setProductNameOnPlace(cateringOrderItemDO.getProductNameOnPlace());
            cateringOrderItemBO.setProductUnitPriceOnPlace(cateringOrderItemDO.getProductUnitPriceOnPlace());
            cateringOrderItemBO.setProductUnitOfMeasureOnPlace(cateringOrderItemDO.getProductUnitOfMeasureOnPlace());
            cateringOrderItemBO.setProductMethodId(cateringOrderItemDO.getProductMethodId());
            cateringOrderItemBO.setProductMethodNameOnPlace(cateringOrderItemDO.getProductMethodNameOnPlace());
            cateringOrderItemBO.setProductMethodGroupNameOnPlace(cateringOrderItemDO.getProductMethodGroupNameOnPlace());
            orderItemBOList.add(cateringOrderItemBO);
        }
        return orderItemBOList;
    }
}
